<template>
	<view class="test">
		<r-header defineClass="header" ref="RHeader" paddingBottom="10">
			<view slot="back">返回</view>
			<view slot="title">标题</view>
		</r-header>
		<view :style="style">页面主体</view>
	</view>
</template>

<script>
	import RHeader from '../../components/r-header/components/r-header/r-header.vue'
	export default {
		components: {
			RHeader,
		},
		data() {
			return {
				title: 'Header'
			}
		},
		computed: {
			style() {
        // #ifdef MP-WEIXIN
        const height = this.$refs.RHeader.data.getHeaderHeight();
        return `padding-top: ${ height };`;
        // #endif
        // #ifdef H5
        return `padding-top: 0;`;
        // #endif
			}
		},
		onLoad() {

		},
		methods: {

		}
	}
</script>

<style>
	.header {
		 /*background-color: red !important;*/
	}
</style>
